﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Reflection;

namespace MyMovieInfo
{
    class ArgumentUtils
    {
        internal static string GetArgument(string[] args, Args argument)
        {
            string defaultPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);            

            if (args.Length == 0)
                return defaultPath;

            if ((int)argument > (args.Length - 1))
                return args[args.Length - 1];
            
            return (args[(int)argument] != null ? Path.GetDirectoryName(args[(int)argument]) : defaultPath);
        }


        public enum Args
        {
            MovieFilePath = 0,
            OutputPath
        }

    }
}
